-- GENERATED SPELL FOR [Auchenai Death-Speaker] --


function spell0_21242(pUnit, Event) --@Curse of Weakness,n/a--
pUnit:FullCastSpellOnTarget(18267,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21242', 30328, 1)
end

function spell1_21242(pUnit, Event) --@Demon Armor,Self--
pUnit:FullCastSpellOnTarget(13787,pUnit)
pUnit:RegisterEvent('Sorts_21242', 0, 1)
end

function spell2_21242(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(9613,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21242', 3000, 1)
end

function Sorts_21242(pUnit, Event)
local choix_sorts_21242 = math.random(0, 2)
if choix_sorts_21242 == 0 then
pUnit:RegisterEvent('spell0_21242', 1, 1)
end
if choix_sorts_21242 == 1 then
pUnit:RegisterEvent('spell1_21242', 1, 1)
end
if choix_sorts_21242 == 2 then
pUnit:RegisterEvent('spell2_21242', 1, 1)
end
end

function mob21242_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_21242', math.random(1500, 3000), 1)
end

function mob21242_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21242_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21242_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(21242, 1, 'mob21242_Action')
RegisterUnitEvent(21242, 2, 'mob21242_Leave')
RegisterUnitEvent(21242, 3, 'mob21242_Kill')
RegisterUnitEvent(21242, 4, 'mob21242_Die')
